1. Field of the Invention
This invention relates to the field of packet routing, and more particularly relates to feature lookup of incoming packets using classification memory.
2. Description of the Related Art
Generally, routers have numerous features that are enabled upon the processing of incoming packets. The features are enabled based on user-specified router configurations. When the incoming packets match a particular pattern (e.g., source address, destination address, incoming port, data rate or the like), the router enables features associated with that pattern. For example, a conventional access control list (ACL) feature determines whether to permit or deny the incoming packets when the incoming packets match a predefined pattern. Similarly, a quality of service (QoS) feature specifies a policing scheme that can be enforced when the incoming packets match a predefined pattern. In software routers, the features are linked to a data structure for incoming packet pattern. When the incoming packet pattern matches a predefined pattern for a data structure, the incoming packet is processed according to the rules defined in the data structure.
However, in hardware routers, typically the data structures are fixed. The pattern of incoming packets is compared against a fixed hardware directory of features or content-addressable memory (CAM). When a match is found, the CAM generates an index. The index is used to access an associated classification memory (CM) that defines the rules for the processing of the incoming packets. Conventionally, in a hardware router (“router”), one CAM bank is assigned for every feature and each CAM bank is associated with a CM that defines the rules for packet processing. For example, when the router has ‘n’ features, ‘n’ CAM banks are assigned for feature lookups. The patterns of incoming packets are matched against each CAM to determine an index to packet processing rule in the associated CM. The routers are pre-configured to include CAM banks for every offered feature.
When a customer application does not use a feature, the CAM bank assigned for that feature cannot be used for other features. For example, when a customer application uses the ACL feature and does not use the QoS feature then the CAM bank assigned to the QoS feature is not used even when the customer exhausts the space in the ACL CAM.
One approach to solve the problem of unused CAM banks is to remove the unused CAM banks and include additional CAM banks for other features. However, when the customer application requires infrequent use of a feature, a CAM bank must be assigned for that feature. For example, when the customer uses one policing entry for QoS feature, an entire CAM bank must be dedicated for the QoS feature. A method and apparatus is needed to CAMs and associated CMs for multi-feature packet processing in a router.